<?xml version="1.0" encoding="UTF-8"?>
	    
		<html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:mshelp="http://msdn.microsoft.com/mshelp" xmlns="http://www.w3.org/1999/xhtml">
	    <head>
        <link rel="stylesheet" type="text/css" href="Styles/spsfbranding.css"/>		
		    		<title>Add Class Resource Files</title>
		      <meta name="Microsoft.Help.Locale" content="en-us" />
      <meta name="Microsoft.Help.TopicLocale" content="en-us" />
      <meta name="Microsoft.Help.SelfBranded" content="true" />
      <meta name="Microsoft.Help.Id" content="SPSF_RECIPE_CLASSRESOURCEFILE" />
      <meta name="Microsoft.Help.TocParent" content="SPSF_RECIPES_CATEGORY_FILES" />      <meta name="Microsoft.Help.TocOrder" content="3" />
      <meta name="Microsoft.Help.Keywords" content="Add Class Resource Files" />
      <meta name="Microsoft.Help.Category" content="HelpFiles" />
      		<meta name="Description" content="This recipe allows to add a file which should be deployed as class resource file for an assembly." />
		<style type="text/css">

		.OH_TocResize
		{	
			top: 126px;
		}

		</style>
	</head>	
	<body class="primary-mtps-offline-document">
	  
		<div class="OH_topic">		 
    <table class="spsfbannertable" height="93" width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="height:93px; background-image: url('ms.help?content/Consultants of Steria Mummert/store/HelpFiles.mshc;_img/header_background.jpg'); background-repeat: repeat-x;"><img src="./_img/header_left.jpg" /></td><td valign="right" style="height:93px; background-image: url('ms.help?content/Consultants of Steria Mummert/store/HelpFiles.mshc;_img/header_background.jpg'); background-repeat: repeat-x; text-align: right;"><img src="./_img/header_right.jpg" /></td></tr></table> 
		  <div class="OH_title">
			<table>
			  <tbody>
				<tr>
				  <td class="OH_tdTitleColumn">
					<div class="subHeading"><small>SharePoint Software Factory 2010</small></div><br />
					Add Class Resource Files
				  </td>
				  <td class="OH_tdLogoColumn">
				  				  </td>
				</tr>
			  </tbody>
			</table>
		  </div>
		</div>
		<div id="mainSection">
			<div id="mainBody">            
				<div class="introduction"><p>This recipe allows to add a file which should be deployed as class resource file for an assembly.</p></div>
				




                      <DIV class="OH_CollapsibleAreaRegion">
					        <DIV class="OH_regiontitle">Recipe Description</DIV>
					        <DIV class="OH_RegionToggle"></DIV>
				        </DIV>
				        <DIV class="OH_clear"></DIV>
				        <p>
                        Class resource files are added to the project in folder 80/BIN/wpresources/[NameOfAssembly]. In manifest.xml these files are deployed to <br />        <br />        &lt;Solution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SolutionId="00000000-0000-0000-0000-000000000000" ResetWebServer="True" xmlns="http://schemas.microsoft.com/sharepoint/"&gt;<br />        &#160;&lt;Assemblies&gt;<br />        &#160;&#160;&lt;Assembly Location="WebPartResources.dll" DeploymentTarget="GlobalAssemblyCache"&gt;<br />        &#160;&#160;&#160;&lt;SafeControls&gt;<br />        &#160;&#160;&#160;&#160;&lt;SafeControl Assembly="WebPartResources, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6763c0814d065309" Namespace="WebPartResources" TypeName="*" Safe="True" /&gt;<br />        &#160;&#160;&#160;&lt;/SafeControls&gt;<br />        &#160;&#160;&#160;&lt;ClassResources&gt;<br />        &#160;&#160;&#160;&#160;<b>&lt;ClassResource Location="testfile.gif" FileName="testfile.gif" /&gt;</b><br />        &#160;&#160;&#160;&lt;/ClassResources&gt;<br />        &#160;&#160;&lt;/Assembly&gt;<br />        &#160;&lt;/Assemblies&gt;<br />        &lt;/Solution&gt;<br />        <br />        After deployment these files are located here.<br />        For assemblies in GAX: C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\WebPartResources\1.0.0.0__6763c0814d065309\testfile.gif<br />        For assemblies in BIN: C:\inetpub\wwwroot\wss\VirtualDirectories\80\wpresources\1.0.0.0__6763c0814d065309\testfile.gif<br />        <br />        In code you can access there files:<br />        <br />        SPWeb currentWeb = SPControl.GetContextWeb(Context);<br />        Type currentType = this.GetType();<br />        string classResourcePath = SPWebPartManager.GetClassResourcePath(currentWeb, currentType);&#160;&#160; <br />        image = new Image();<br />        image.ImageUrl = classResourcePath + "/testfile.gif";<br />        <br />        The file could also be access via URL:<br />        <br />        http://servername/_wpresources/[assemblyname]/testfile.gif<br />        
				        </p>
				                   
                           <DIV class="OH_CollapsibleAreaRegion">
					<DIV class="OH_regiontitle">Arguments</DIV>
					<DIV class="OH_RegionToggle"></DIV>
				</DIV>
				<DIV class="OH_clear"></DIV>
				<p>
                <table id="argumentTable" width="100%">
                    <tr>
                        <th>Name</th>
                        <th>Description</th>
                    </tr>							<tr>
								<td>Source Files</td>
								<td></td>
							</tr>                
							                </table>
				</p>
                           <DIV class="OH_CollapsibleAreaRegion">
				<DIV class="OH_regiontitle">Authors</DIV>
				<DIV class="OH_RegionToggle"></DIV>
			</DIV>
			<DIV class="OH_clear"></DIV>  
			<p>
           <ul>
           <li>Torsten Mandelkow</li>           </ul>
           </p>
           
		   <DIV class="OH_CollapsibleAreaRegion">
				<DIV class="OH_regiontitle">Version history</DIV>
				<DIV class="OH_RegionToggle"></DIV>
			</DIV>
			<DIV class="OH_clear"></DIV>  
		   <p>
           <ul>
           <li>1.0 Initial Recipe</li>           </ul>
		   </p>



     
				</div>			
			</div>
							<div class="OH_feedbacklink"><hr size="1" />SharePoint Software Factory 2010, Version 3.2, see <a href="ms.help?method=page&amp;id=SPSF_OVERVIEW_800_LICENSE&amp;topicversion=0&amp;topiclocale=&amp;SQM=1&amp;product=VS&amp;productVersion=100&amp;locale=EN-US">License</a> for more information</div>
				<br />
					</body>
</html>


